package com.itheima.hkzfapi.test;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.HkzfApiApplication;
import com.itheima.dto.HouseDTO;
import com.itheima.dto.HouseFilter;
import com.itheima.mapper.HousesMapper;
import com.itheima.service.IHousesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @ClassName test02
 * @Description TODO
 * @Author Shinelon
 * @Date DATE 2021/8/27 12:22
 */

@RunWith(SpringRunner.class)
@SpringBootTest(classes = HkzfApiApplication.class)

public class test02 {
    @Autowired
    HousesMapper housesMapper;
    @Autowired
    IHousesService housesService ;
    @Test
    public void run() throws IOException {


        // housesService.selectHouseByFileter(houseFilter,);
        Map<String,Object> map = new HashMap<>();
        List<Integer> list  = new ArrayList<>();
        list.add(500);
        list.add(1000);
        map.put("money",list);
        List<String> list1=new ArrayList<>() ;
        list1.add("成都");
        map.put("distinct","12");
        map.put("keywords",list1);
        map.put("subway","1号线");
        map.put("payway","整租");
        map.put("direction",list);
        map.put("floor","123");
        map.put("tags",list);
        Page<HouseDTO> page = new Page<>(1,10);
        IPage<HouseDTO> all= housesMapper.selectByFilter(page, map);
    }
}
